<html>
    <head>
        <script>
            function showResults(term, location)
            {
                if (term.length == 0)
                {
                    document.getElementById("txtHint").innerHTML = "";
                    return;
                }
                if (window.XMLHttpRequest)
                {// code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp = new XMLHttpRequest();
                }
                else
                {// code for IE6, IE5
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.onreadystatechange = function()
                {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
                    {
                        document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
                    }
                }
                //xmlhttp.open("GET", "gethint.php?q=" + str, true);
                xmlhttp.open("GET", "yelp.php?term=" + term + "&location=" + location, true);
                xmlhttp.send();
            }
        </script>
    </head>
    <body>
        <div id="fb-root"></div>
        <div style="text-align:center">
            <h2>Eat Well</h2>        
        <script>(function(d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id))
                    return;
                js = d.createElement(s);
                js.id = id;
                js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=523682457680450";
                fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));</script>
        
        <div class="fb-login-button" data-show-faces="true" data-width="100" data-max-rows="1"></div>
        </div>
        <hr>
        <form> 
            <table>
                <tr>
                    <td>
                        <b>What ya feelin' like?</b>
                    </td>
                    <td>
                        <input id="term" type="text"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>Where y'at?</b>
                    </td>
                    <td>
                        <input id="location" type="text"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        <button id="submit" type="button" onclick="showResults(document.getElementById('term').value, document.getElementById('location').value);">Find Food</button>
                    </td>
                </tr>
            </table>
            
            <br/>
                       
        </form>
        <p><span id="txtHint"></span></p>

    </body>
</html>
